package com.ww.java8.fp.stream;

import static java.util.stream.IntStream.range;

/**
 * repeat()替换简单的for循环
 *
 * @author wanggw
 * @date 2023-03-08 00:41:08
 */
public class Repeat {

    public static void repeat(int n, Runnable action) {
        range(0, n).forEach(i -> action.run());
    }
}
